import service from './request'


export function getStudents(params) {
    let {pagenum,pagesize,query}=params
    if (query)
    {
        return service.get('/students?page='+pagenum+'&page_size='+pagesize+'&name='+query)
    }
    else{
        return service.get('/students?page='+pagenum+'&page_size='+pagesize)
    }
}
export function addStudents(params) {
    return service.post('/students',params)
}
export function removeStudents(id) {
    return service.delete('/students/'+id)
}

export function getStudentsItem(id) {
    return service.get('/students/'+id)
}

export function editStudentsItem(id,name) {
    return service.put('/students/'+id,{name})
}

export function downloadTemp() {
    return service.get('/students/download')
}